package com.xls.boxlibrary.adapter;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.core.content.ContextCompat;

import com.xls.boxlibrary.R;
import com.xls.boxlibrary.entity.TiXianJiLuEntity;


public class TiXianJiLuViewHolder extends MvpRVViewHolder<TiXianJiLuEntity> {
    private TextView tixianjilu_time;
    private TextView tixianjilu_title_1;
    private TextView tixianjilu_jibi_num;
    private ImageView tixianjilu_tixianzhuangtai;

    public TiXianJiLuViewHolder(Context context, ViewGroup p) {
        super(R.layout.item_tixianjilu, context, p);
    }

    @Override
    public void initView() {

        tixianjilu_time = itemView.findViewById(R.id.tixianjilu_time);
        tixianjilu_title_1 = itemView.findViewById(R.id.tixianjilu_title_1);
        tixianjilu_jibi_num = itemView.findViewById(R.id.tixianjilu_jibi_num);
        tixianjilu_tixianzhuangtai = itemView.findViewById(R.id.tixianjilu_tixianzhuangtai);

        tixianjilu_time.setText(viewData.getCreateTime());
        tixianjilu_jibi_num.setText(viewData.getCoins()+" 金币");

        if (viewData.getStatus()==0){
            tixianjilu_tixianzhuangtai.setImageResource(R.drawable.ic_state_tixian0);
        }else if (viewData.getStatus()==-1){
            tixianjilu_tixianzhuangtai.setImageResource(R.drawable.ic_state_tixian3);//
        }else if (viewData.getStatus()==1){
            if (viewData.getPayStatus()==1){
                tixianjilu_tixianzhuangtai.setImageResource(R.drawable.ic_state_tixian1);
            }else {
                tixianjilu_tixianzhuangtai.setImageResource(R.drawable.ic_state_tixian0);
            }
        }

    }
}
